<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人资料 - ${site.name} - bbs</title>
<link href="${resSys}/front.css" rel="stylesheet" type="text/css"/>
<script src="${resSys}/jquery.js" type="text/javascript"></script>
<link href="/${res}/bbs_forum/css/whole.css" type="text/css" rel="stylesheet" />
<link href="/${res}/bbs_forum/css/layout.css" type="text/css" rel="stylesheet" />
<link href="/${res}/bbs_member/css/set.css" type="text/css" rel="stylesheet" />
<style type="text/css">
    #set-menu li.current1{background:url(/${res}/bbs_member/img/fav-cur.gif) no-repeat 0 0.5em;}
    #set-menu li.current1 a{color:#707070;font-weight:700}
</style>
<script type="text/javascript">
	function g(o){
		return document.getElementById(o);
	}
	function HoverLi(m,n,counter){
		for(var i=1;i<=counter;i++){
			g('tb_'+m+i).className='';
			g('tbc_'+m+i).className='undis';
		}
		//alert('tbc_'+m+n);
		g('tb_'+m+n).className='current';
		g('tbc_'+m+n).className='dis';
	}
	$(function() {
		$("#jvForm").validate();
	});
	function setCreditOutValue() {
		if($("#creditIn").val()!=""&&$("#creditIn").val()!=0&&$("#creditOutType").val()!=$("#creditInType").val()){
			$.post('${base}/member/getCreditOutValue.jspx', 
			{
				creditIn:$("#creditIn").val(),
				creditInType:$("#creditInType").val(),
				creditOutType:$("#creditOutType").val(),
				exchangetax:$("#exchangetax").val()
			}, function(data) {
				$("#creditOut").val(data.creditOutValue);
			},"json");
		}else{
			$("#creditOut").val("");	
		}
	}
	function exchange() {
		if($("#creditIn").val()==""){
			alert("抱歉，您尚未输入需要兑换的数量");
		}else if($("#creditOut").val()==""){
			alert("您要兑换的积分相同，无法兑换");
		}else if($("#password").val()==""){
			alert("您需要输入密码");
		}else{
			$.post('${base}/member/creditExchange.jspx', 
					{
						creditIn:$("#creditIn").val(),
						creditOut:$("#creditOut").val(),
						creditOutType:$("#creditOutType").val(),
						password:$("#password").val()
					}, function(data) {
						alert(data.message);
					},"json");
			}
	}
</script>
</head>
<body>
 <!--header-->[#include "../include/header.html"/]<!--/header-->
    <!--main-->
    <div class="main-wrap">
    <div id="main">
    <div id="breadCrumb"><img alt="" align="absMiddle" style="cursor: pointer" src="/${res}/bbs_forum/img/home.gif" /> <a href="${base}/">${site.name}</a> &raquo; <a href="${base}/member/index.jhtml">会员中心</a> &raquo;个人资料</div>
    <div id="set-wrap">
    <div id="set-side">
    <div id="set-side-wrap">
    [#include "memberCenterMenu.html"/]
    </div>
    </div>
    <div id="set-content">
    <div class="cc" id="set-content-wrap">
    <div>
    <div class="set-tab-table">
    <table cellspacing="0" cellpadding="0" border="0">
      <tbody>
        <tr class="tac" id="infolist">
        [#assign menunum=2]
        [#if exchangeAvailable]
        	[#assign menunum=3]
        [/#if]
          <td class="current" id="tb_11"><a onClick="HoverLi(1,1,'${menunum!}');" style="cursor: pointer">我的积分</a></td>
          [#if exchangeAvailable]<td id="tb_12"><a onClick="HoverLi(1,2,'${menunum!}');" style="cursor: pointer">兑换</a></td>[/#if]
          <td id="tb_1${menunum!}"><a onClick="HoverLi(1,'${menunum!}','${menunum!}');" style="cursor: pointer">积分规则</a></td>
        </tr>
      </tbody>
    </table>
    </div>
    <form id="creator" action="${base}/member/update.jspx" method="post" enctype="multipart/form-data" onSubmit="return procheck(this)" name="creator">
      <div class="set-tab-box">
      <div class="dis" id="tbc_11">
      <table class="set-table2" cellspacing="0" cellpadding="0" width="100%" border="0">
        <tbody>
          <tr>
            <td class="td1" width="25%">积分</td>
            <td>
            ${user.point!}
           </td>
          </tr>
          <tr>
            <td class="td1">威望</td>
            <td>
            ${user.prestige!}
            </td>
          </tr>
        </tbody>
      </table>
      </div>
      <div class="undis" id="tbc_12">
      [#if exchangeAvailable]
      <table class="set-table2" cellspacing="0" cellpadding="0" width="100%" border="0">
        <tbody>
         <tr>
            <td class="td1" width="25%">积分</td>
            <td>
            ${user.point!}
           </td>
            <td class="td1">威望</td>
            <td>
            ${user.prestige!}
            </td>
          </tr>
          <tr>
            <td class="td1" width="25%">兑换</td>
            <td>
	            <input name="creditIn" class="required digits" id="creditIn" onchange="setCreditOutValue()"/>
	            <select name="creditInType" id="creditInType" onchange="setCreditOutValue()">
	            [#if pointInAvail]<option value="1">积分</option>[/#if]
	            [#if prestigeInAvail]<option value="2">威望</option>[/#if]
	            </select>
           </td>
            <td class="td1">
            	 所需
	            <input name="creditOut" readonly="readonly" id="creditOut"/>
	            <select name="creditOutType" onchange="setCreditOutValue()" id="creditOutType">
	            [#if prestigeOutAvail]<option value="2">威望</option>[/#if]
	            [#if pointOutAvail]<option value="1">积分</option>[/#if]
	            </select>
            </td>
            <td>
               [#if creditExchangeRule.exchangetax!=0]
               		兑换税${creditExchangeRule.exchangetax*100}%
               [/#if]
               <input type="hidden" name="exchangetax" id="exchangetax" value="${creditExchangeRule.exchangetax!}"/>
               [#if creditExchangeRule.miniBalance!=0]
               		兑换后最低余额${creditExchangeRule.miniBalance!}
               [/#if]
            </td>
          </tr>
          <tr>
            <td class="td1" width="25%">登录密码</td>
            <td colspan="3"><input class="input" type="password" maxlength="75" name="password" id="password"/></td>
          </tr>
        </tbody>
      </table>
      <div class="tac" style="padding-right: 1em; padding-left: 1em; padding-bottom: 1em; padding-top: 1em">
      <input class="input" type="hidden" maxlength="75" name="userid" value="${user.id!}"/>
      <input class="btn" type="button" name="submit" value="兑换" onclick="exchange()"/></div>
      [/#if]
      </div>
      <div class="undis" id="tbc_13">
      <table class="set-table2" cellspacing="0" cellpadding="0" width="100%" border="0">
        <tbody>
          <tr>
            <td class="td1" width="25%">板块</td>
            <td class="td1" width="25%">动作</td>
            <td class="td1" width="25%">积分</td>
            <td class="td1" width="25%">威望</td>
          </tr>
          [#list forums as forum]
          <tr>
            <td class="td1" width="25%">${forum.title!}</td>
            <td class="td1" width="25%">发表主题</td>
            <td class="td1" width="25%">${forum.pointTopic!}</td>
            <td class="td1" width="25%">${forum.prestigeTopic!}</td>
          </tr>
          <tr>
            <td class="td1" width="25%">${forum.title!}</td>
            <td class="td1" width="25%">发表回复</td>
            <td class="td1" width="25%">${forum.pointReply!}</td>
            <td class="td1" width="25%">${forum.prestigeReply!}</td>
          </tr>
          <tr>
            <td class="td1" width="25%">${forum.title!}</td>
            <td class="td1" width="25%">被加精华1</td>
            <td class="td1" width="25%">${forum.pointPrime!}</td>
            <td class="td1" width="25%">${forum.pointPrime1!}</td>
          </tr>
          <tr>
            <td class="td1" width="25%">${forum.title!}</td>
            <td class="td1" width="25%">被加精华2</td>
            <td class="td1" width="25%">${forum.pointPrime!}</td>
            <td class="td1" width="25%">${forum.pointPrime2!}</td>
          </tr>
          <tr>
            <td class="td1" width="25%">${forum.title!}</td>
            <td class="td1" width="25%">被加精华3</td>
            <td class="td1" width="25%">${forum.pointPrime!}</td>
            <td class="td1" width="25%">${forum.pointPrime3!}</td>
          </tr>
          <tr>
            <td class="td1" width="25%">${forum.title!}</td>
            <td class="td1" width="25%">被解除精华(减)</td>
            <td class="td1" width="25%">0</td>
            <td class="td1" width="25%">${forum.pointPrime0!}</td>
          </tr>
          [/#list]
        </tbody>
      </table>
      </div>
      </div>
    </form>
    </div>
    </div>
    </div>
	</div>
    </div>
    <!--/main-->
	<!--footer-->[#include "../include/footer.html"/]<!--footer-->
  </body>
</html>